package com.at7122.security_demo.controller;

import com.at7122.security_demo.entity.User;
import com.at7122.security_demo.service.UserService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    public UserService userService;

    @GetMapping("/list") //发送get请求
    public List<User> getList(){
        return userService.list();
    }
}
